package com.basker.pisces.domain.command.event;

import com.basker.pisces.domain.command.exception.CommandExecuteRuntimeException;
import com.basker.pisces.domain.command.run.CommandRunner;

/**
 * 命令执行失败的事件
 *
 * @author hangwen
 */
public class CommandExecuteFailureEvent extends CommandExecuteEvent {

    private static final long serialVersionUID = -6934048319989657424L;

    private CommandExecuteRuntimeException cause;

    public CommandExecuteFailureEvent(CommandRunner<?> runner, Object[] dataObjects,
                                      CommandExecuteRuntimeException cause) {
        super(runner, dataObjects);
        this.cause = cause;
    }

    /**
     * 获取导致失败的异常
     *
     * @return
     */
    public CommandExecuteRuntimeException getCause() {
        return cause;
    }

}
